

/*
    Copyright 2011,2012 Calum Stuart Cookson.

    This file is part of Bio Mongoose.

    Bio Mongoose is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Bio Mongoose is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Bio Mongoose.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef ALPHABET_H
#define ALPHABET_H

#include "reporting.h"

#include <string>
#include <set>
#include <map>
#include <iostream>

class alphabet : public reportable
{
    private:
    std::map<char, int> letter_to_index;
    std::map<int, char> index_to_letter;
    std::set<std::string> alphabet_set;
    int alphabet_size;

    public:
    alphabet();
    alphabet(std::string sequence);
    char get_letter_from_index(int index) const;
    int get_index_from_letter(char letter) const;
    int add_letter(char letter);
    bool contains(char letter) const;
    unsigned int size() const;
    void clear();
    void extract_from_string(std::string sequence);
    std::set<std::string> get_set();
    std::ostream& report(std::ostream& out);
};

#endif // ALPHABET_H
